/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

@include ouiPanel($selector: '.ouiCommentEvent--regular');

.ouiCommentEvent {
  overflow: hidden;
}

.ouiCommentEvent__header {
  line-height: $ouiLineHeight;
  display: flex;
  align-items: center;
}

.ouiCommentEvent__headerData {
  align-items: center;
  display: flex;
  flex-wrap: wrap;

  > div {
    padding-right: $ouiSizeXS;
  }
}

.ouiCommentEvent__headerUsername {
  font-weight: $ouiFontWeightSemiBold;
}

.ouiCommentEvent--regular {
  @include ouiSlightShadow;
  border-radius: $ouiBorderRadius;
  border: $ouiBorderThin;

  .ouiCommentEvent__header {
    min-height: $ouiSizeXXL;
    background-color: $ouiColorLightestShade;
    border-bottom: $ouiBorderThin;
    padding: $ouiSizeXS $ouiSizeS;

    /**
     * Fix for IE when using align-items:center in an item that has min-height
        (https://github.com/philipwalton/flexbugs/issues/231#issuecomment-362790042)
     */
    // sass-lint:disable-block mixins-before-declarations
    @include internetExplorerOnly {
      &::after {
        content: '';
        // Calculates the minimum height based on full header's min-height minus the vertical padding
        min-height: $ouiSizeXXL - $ouiSizeS;
        font-size: 0;
        display: block;
      }
    }
  }

  .ouiCommentEvent__headerData {
    // Push the actions far right
    flex-grow: 1;
  }

  .ouiCommentEvent__body {
    padding: $ouiSizeS;
  }
}

.ouiCommentEvent--update {
  .ouiCommentEvent__header {
    justify-content: flex-start;
    padding: $ouiSizeXS 0;
  }

  .ouiCommentEvent__headerData {
    padding-right: $ouiSizeS;
  }

  .ouiCommentEvent__body {
    padding-top: $ouiSizeXS;
  }
}
